/*
 * Copyright (c) 2022-2022 All rights Reserved.
 */

package com.driving.core.advice;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import com.driving.core.exception.DrivingHtmlException;

import lombok.extern.slf4j.Slf4j;

/**
 * 页面异常处理
 *
 * @author SAGITTAR
 * @since 2017
 */
@Slf4j
@ControllerAdvice(annotations = { Controller.class })
public class DrivingExceptionHtmlAdvice {

    @ExceptionHandler
    public String handleDrivingException(DrivingHtmlException e) {
        log.error(e.getLocalizedMessage(), e);
        return "index";
    }
}
